1. Field of the Invention
The present invention relates to a network system, a layer 3 communication device, a layer 2 communication device, and a route selection method that make it possible to always select an optimum route for communication through a layer 2 network.
2. Description of the Related Art
In recent years, a large-scale network is often built as a layer 2 network because, for example, it is relatively inexpensive to install the layer 2 network. In building the layer 2 network, a loop of a packet occurs depending on a connection configuration of layer 2 switches (layer 2 communication devices). This leads to a phenomenon called broadcast storm, in which a network collapses.
To avoid the broadcast storm, it is necessary to establish a connection form of the layer 2 switches in a tree structure physically or logically. In a system generally adopted, layer 2 switches are connected in a form of a mesh or a ring physically, and a part of a network is blocked logically to establish a tree structure. In this system, when a fault occurs, it is possible to maintain communication connection by removing a block or moving a position of the block, thereby realizing high redundancy.
To block a part of a layer 2 network, a control protocol such as a Spanning Tree Protocol (STP) may be used. By running such a control protocol on the layer 2 switches, it is possible to cause the layer 2 switches to set a logical block autonomously. The STP is defined in “Media Access Control (MAC) Bridges”, [online], June 2004, retrieved from the Internet: <URL: http://standards.ieee.org/getieee802/download/802.1D-2004.pdf>.
FIG. 13 is a diagram of the layer 2 network. Layer 2 switches (L2SW) 1000a to 1000c are connected to one another physically to constitute the layer 2 network. The layer 2 switch 1000a is connected to an Internet Protocol (IP) network 3000a through a router (a layer 3 communication device) 2000a. Similarly, the layer 2 switch 1000b is connected to an IP network 3000b through a router 2000b. The layer 2 switch 1000c is connected to an IP network 3000c through a router 2000c. 
It is assumed here that data is transmitted from the IP network 3000a to the IP network 3000c. In this case, a packet for transmitting the data passes through the layer 2 network. Because the layer 2 switches 1000a to 1000c are connected in a form of a ring, it is likely that the packet goes into a loop. Thus, a logical block is set in a part of the network (in this example, between the layer 2 switches 1000b and 1000c) such that the packet cannot pass through the blocked part.
However, when part of the network is blocked, communication through the layer 2 network is not performed on an optimum route. In the example shown in FIG. 13, communication between the IP networks 3000a and 3000b and communication between the IP networks 3000a and 3000c are performed on an optimum route. However, since communication between the IP networks 3000b and 3000c is performed on a route through the layer 2 switch 1000a, the communication is not performed on an optimum route.
In this example, a band between the layer 2 switches 1000b and 1000c is not used effectively. Communication, which should actually be performed between the layer 2 switches 1000b and 1000c, consumes a band between the layer 2 switches 1000a and 1000b and a band between the layer 2 switches 1000a and 1000c. 